<?php

function extractCsrfToken($text) {
	// Define the regular expression pattern
	$pattern = '/x-csrf-token:\s*([^^]+)\^"/';

	// Perform the regex match
	if (preg_match($pattern, $text, $matches)) {
		// Return the matched group
		return trim($matches[1]);
	}

	// Return null if no match is found
	return null;
}
